import QtQuick 1.0

Rectangle {
    width: 1280
    height: 800
    id: page
    property string title: "sbs2: data"
    color: "black"
    property bool stimuliVisbile: false
    property double setupScreenOpacity: 1.0
    property bool mainTimerRunning: false
    state: "startupScreen"
    property double tickFreq: 128 / 4.0 //32 times per second tick
    //property int picturesToShow : verb.length
    property string pictureType: "rest"
    property int eventCountdown: 0

    //signals
    signal event(string eventType);
    signal startRecording(string user, string desc);

    //slots
    function cqUpdated(channel, value)
    {
	setupScreen.cqValue(channel,value);
    }



    states: [
	   State {
	       name: "startupScreen"
	       PropertyChanges {
		   target: page
	       }
	   },
	   State {
	       name: "show"
	       PropertyChanges {
		   target: page
		   stimuliVisbile: true
		   setupScreenOpacity: 0
		   mainTimerRunning : true
	       }

	   }
       ]

    SetupScreen{id: setupScreen;  opacity: setupScreenOpacity;}
    //Verb{id: verb; visible: stimuliVisbile}


    function timeTick()
    {
	/*
	if (!mainTimerRunning)
	    return;

	--eventCountdown;
	if (eventCountdown > 0)
	    return;

	if (pictureType == "rest")
	{
	    verb.timeTick(pictureType);
	    pictureType = "cross";
	    eventCountdown = tickFreq * 1; //one sec
	}
	else if (pictureType == "cross")
	{
	    verb.timeTick(pictureType);
	    pictureType = "picture";
	    eventCountdown = tickFreq * 0.5; //half sec
	}
	else if (pictureType == "picture")
	{
	    verb.timeTick(pictureType);
	    pictureType = "rest";
	    eventCountdown = tickFreq * 1; //one sec
	}
	*/

    }


}
